import ResultWrapper = require('../ResultWrapper')
import RequestResult = require("../RequestResult")
import RequestListResult = require("../RequestListResult")
import BaseModel = require('../BaseModel')
import ReplenishOrder = require('../model/ReplenishOrder')
//code1

//code1

/**
 * 补货单详情
 */
class OrderApiReplenishOrderDetail {
    
    get path(): string {
        return '/OrderApi/replenishOrderDetail'
    }
    
    get isUpload(): boolean {
        return false
    }

    setup(app: any, path: string) {
        console.log('setup service: /' + path)
    }

    //GET
    find(params: any, callback: Function) {
        return this.doWork(params.query)
    }

    doWork(params: any): Promise<any> {

        /**补货单id*/
        let replenish_order_id: number = params.replenish_order_id


        let callback = (
            resolve: (data: RequestResult<ReplenishOrder>) => void, 
            reject: (error: Error) => void) => {

            let data = new ReplenishOrder()
            let result = ResultWrapper.wrap(data)
            result.message = '假数据'

//code2

//code2
            resolve(result)
        }
        return new Promise(callback)
    }
}

export = OrderApiReplenishOrderDetail